/*InspectInfo  检查基本信息*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const InspectInfoApi = {

    getPageData(data: any) {
        return request({
            url: "/inspectInfo/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/inspectInfo/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/inspectInfo/save",
            method: "post",
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/inspectInfo/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/inspectInfo/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(_searchParam: any,_xlsTitle: any) => {
           const param = new URLSearchParams();
        param.append("_searchParam",JSON.stringify(_searchParam))
        param.append("_xlsTitle",_xlsTitle)
        return request({
            url: "/inspectInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
          params:param,
        }).then((res)=> {
            download(res)
        });
    },
            pageDataXlss:(id: any) => {
        const param = new URLSearchParams();
        param.append("inspectInfoIds", id)
        return request({
            url: "/inspectInfo/pageDataXls2",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
            params:param,

        }).then((res)=> {
            download(res)
        });
    },
        getSysTownList(params: any){
        return request({
            url: "/area/gettwon",
            method: "get",
            params 
        })
    }
};
export default InspectInfoApi;
